from sympy import Symbol, diff

if __name__ == '__main__':
    x = Symbol("x")
    y = Symbol("y")
    expression = x**2 + 3*x*y  + y**2

    derivative_x = diff(expression, x)
    derivative_y = diff(expression, y)

    print("derivative_x = ", derivative_x)
    print("derivative_y = ", derivative_y)

    derivative_x_value = derivative_x.subs(x, 1).subs(y, 2)
    print("derivative_x_value = ", derivative_x_value)

    derivative_y_value = derivative_y.subs(x, 1).subs(y, 2)
    print("derivative_y_value = ", derivative_y_value)
